//单元格编辑后回调的方法
efgrid_onDataCellSaved = function( grid_id, row_index, col_index, cell_value ) 
{
	  var grid = efgrid.getGridObject( grid_id ); 
	  if( col_index == 1) 
	  { 
		  var info=_getEi();
		  var eiBlock=info.getBlock("cmes.ch.roadway");
		  for(var i=0;i<eiBlock.getRows().length;i++)
		  {
 			  var _value = eiBlock.getCell(i,"value");	//主键
			  if(_value==cell_value)
			  {
				  var fdDepartmentId = eiBlock.getCell(i,"fdDepartmentId");
				  var fdRoadwayType = eiBlock.getCell(i,"fdRoadwayType");		// 巷道类型 --
				  var fdMineRockId = eiBlock.getCell(i,"fdMineRockId");			// 煤岩类别 --
				  var fdBoringProcess = eiBlock.getCell(i,"fdBoringProcess");	// 掘进方式 -- 
				  var fdRoadwayUsing =  eiBlock.getCell(i,"fdRoadwayUsing");	// 巷道用途
				  
				  grid.setCellValue(row_index, 0, fdDepartmentId, TYPE_DATA);	// 施工单位
				  grid.setCellValue(row_index, 2, fdRoadwayType, TYPE_DATA);	// 巷道类型 
				  grid.setCellValue(row_index, 3, fdMineRockId, TYPE_DATA);		// 煤岩类别
				  grid.setCellValue(row_index, 4, fdBoringProcess, TYPE_DATA);	// 掘进方式
				  grid.setCellValue(row_index, 5, fdRoadwayUsing,TYPE_DATA);	// 巷道用途
				  
				  grid.refreshCell( row_index, 0 , TYPE_DATA );
				  grid.refreshCell( row_index, 2 , TYPE_DATA );
				  grid.refreshCell( row_index, 3 , TYPE_DATA );
				  grid.refreshCell( row_index, 4 , TYPE_DATA );
				  grid.refreshCell( row_index, 5 , TYPE_DATA );
			  }			  
		  }
	  } 
}

button_insert_onclick = function (){
	if (isSelected("ef_grid_result") == 0)return; 
	efgrid.submitForm( "ef_grid_result", "ZM","ZMCH72","insert",true);
}

button_update_onclick = function (){
	if (isSelected("ef_grid_result") == 0)return; 
	efgrid.submitForm( "ef_grid_result", "ZM","ZMCH72","update",true);
}

button_delete_onclick = function (){
	var grid=isSelected("ef_grid_result");
	if (grid == 0)return; 
	EFConfirm('你确认要删除吗?', '确认框', function(r) {
		if(r)efgrid.submitForm( "ef_grid_result", "ZM","ZMCH72","delete",true);
	}); 
}

efgrid_onAjaxSubmitSuccess = function(gridId, service_name, method_name, eiInfo) {
	if(gridId == "ef_grid_result") {

		if (eiInfo.status != -1) {
			var grid = efgrid.getGridObject("ef_grid_result");
			grid.refresh( eiInfo );
			window.parent.refresh_main_grid();
		}
		else
		{
			submitCallBackEiMsg = eiInfo.msg;
		}
	} else {
		var grid = efgrid.getGridObject(gridId);
		grid.refresh( eiInfo );
	}
};
